package fun.xinnix.utils;


//import com.spire.xls.FileFormat;
//import com.spire.xls.Workbook;
//import com.spire.xls.Worksheet;
//
//import java.io.OutputStream;

//public class FileConvertUtil {
//    public static void convertExcelToPdf(String filePath, String targetPath) {
//        Workbook workbook = new Workbook();
//        workbook.loadFromFile(filePath);
//        //设置转换后的PDF页面高宽适应工作表的内容大小
//        workbook.getConverterSetting().setSheetFitToPage(true);
//
//        //将生成的文档保存到指定路径
////        workbook.saveToFile(targetPath, FileFormat.PDF);
//        Worksheet worksheet = workbook.getWorksheets().get(1);
//        worksheet.saveToHtml(targetPath);
//    }
//}

//package fun.xinnix;
//
//import cn.hutool.core.date.DateUtil;
//import cn.hutool.core.io.FileUtil;
//import cn.hutool.core.io.resource.ResourceUtil;
//import cn.hutool.core.lang.Console;
//import fun.xinnix.utils.FileConvertUtil;
//import lombok.Data;
//import org.junit.jupiter.api.Test;
//import org.springframework.boot.test.context.SpringBootTest;
//
//import java.io.*;
//import java.util.ArrayList;
//import java.util.Date;
//import java.util.List;
//
//@SpringBootTest
//public class FileTest {
//    public static void main(String[] args) {
//        try (BufferedOutputStream bo = new BufferedOutputStream(new FileOutputStream("E:\\temp\\test.txt"))) {
//            String s = "床前明月光，疑是地上霜aaa";
//            bo.write(s.getBytes());
//            bo.write("鹅鹅鹅".getBytes());
//        } catch (IOException e) {
//
//        }
//    }
//
//    public static List<String> genCurveXTime() {
//        List<String> dateList = new ArrayList<>();
//        Date date;
//        date = DateUtil.parse(DateUtil.format(new Date(), "HH:mm"), "HH:mm");
//        int i = 7;
//        while (i >= 1 && i <= 7) {
//            dateList.add(DateUtil.format(DateUtil.offsetHour(date, -2 * i), "HH:mm"));
//            i--;
//        }
//        dateList.add(DateUtil.format(date, "HH:mm"));
//        return dateList;
//    }
//
//
//    @Test
//    void convertPdf() throws IOException {
//        String fileName = "执常委导入模板.xlsx";
//        String pdfFileName = "fileKey.pdf";
//        FileOutputStream fileOutputStream = new FileOutputStream(fileName);
//        FileOutputStream resultOutputStream = new FileOutputStream(pdfFileName);
//        try (fileOutputStream; resultOutputStream) {
////            FileConvertUtil.convertExcelToPdf(fileName, resultOutputStream);
//        } catch (Exception e) {
//            e.printStackTrace();
//        } finally {
//            fileOutputStream.close();
//            resultOutputStream.close();
//            FileUtil.del(new File(fileName));
//        }
//    }
//
//    @Test
//    void convertExcelPdf() {
//        String fileName = "执常委导入模板.xlsx";
////        String pdfFileName = "fileKey.pdf";
//        String pdfFileName = "fileKey.html";
//        try {
//            FileConvertUtil.convertExcelToPdf(fileName, pdfFileName);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//    }
//
//    @Data
//    class TimeDto {
//        private String startTime;
//        private String endTime;
//    }
//}
